<script>
/**
 * 故障分布
 * 饼图
 */
import PieCharts from "@/pages/report/componet/chartCom/pie-charts.vue";

export default {
  name: "dev-gzfb",
  components: {
    PieCharts: PieCharts
  },
  props: {
    year: {
      type: String,
      default: () => {
        return new Date().getFullYear().toString()
      },
    },

    // 饼图半径
    radius: {
      type: String,
      default: () => {
        return '50%'
      }
    },

    showLabel: {
      type: Boolean,
      default: () => {
        return true
      }
    }

  },

  data() {
    return {
      title: this.year + '设备故障分布',
      showTooltip: true,
      showLegend:true,
      data: [
        {value: 1048, name: '一工场'},
        {value: 735, name: '二工场'},
        {value: 580, name: '物资部'},
        {value: 484, name: '生产保障部'},
        {value: 300, name: '分段制造部'}
      ]
    }
  },


  methods: {
    searchData() {
      this.$refs.gzfbPie.refreshOptions();
    },
  }


}
</script>

<template>
  <view class="line-box">
    <pie-charts
        ref='gzfbPie'
        :showTooltip="showTooltip"
        :title="title"
        :datas="data"
        :showLegend="showLegend"
        :radius="radius"
        :showLabel="showLabel"
    />
  </view>
</template>

<style scoped lang="scss">

</style>